package JAVASE519.gedou;

public class gedoutest {
    public static void main(String[] argc){
        gedoubean juese1=new gedoubean("乔峰",100);
        gedoubean juese2=new gedoubean("鸠摩智",100);
        System.out.println(juese1.getName());
        System.out.println(juese2.getName());
        //开始格斗
        while (true){
            //角色1攻击角色2
            juese1.attack(juese2);
            if(juese2.getBlood()==0){
                System.out.println(juese1.getName()+"KO了"+juese2.getName());
                break;
            }
            //角色2攻击角色1
            juese2.attack(juese1);
            if(juese1.getBlood()==0){
                System.out.println(juese2.getName()+"KO了"+juese1.getName());
                break;
            }
        }
    }
}
